package com.kevin.mediator;

/**
 * 中介者模式测试类
 *
 * @author kevin
 * @date 2025/8/22
 */
public class MediatorTest {

    public static void main(String[] args) {
        Mediator mediator = new ConcreteMediator();
        Colleague colleague1 = new ConcreteColleague1();
        Colleague colleague2 = new ConcreteColleague2();

        mediator.register(colleague1);
        mediator.register(colleague2);

        colleague1.send();
        System.out.println("---------------- 同事1 发送请求完毕 --------------------");

        colleague2.receive();
        System.out.println("---------------- 同事2 接收请求完毕 --------------------");
    }
}
